﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;

namespace System.Linq
{
	public class ParameterExpressionVisitor : ExpressionVisitor
	{
		private readonly ParameterExpression _newParameterExpression;

		public ParameterExpressionVisitor(ParameterExpression p)
		{
			_newParameterExpression = p;
		}

		public Expression ChangeParameter(Expression exp)
		{
			return Visit(exp);
		}

		protected override Expression VisitParameter(ParameterExpression p)
		{
			return _newParameterExpression;
		}
	}
}
